#include "chooselevelscene.h"

ChooseLevelScene::ChooseLevelScene(QWidget *parent) : QMainWindow(parent)
{
    //创建菜单栏
    mymenubar=new SetMenuBar(this);

    //创建返回按钮
    btn_back=new MyPushButton(":/res/BackButton.png");
    btn_back->setParent(this);
    btn_back->move(this->width()-btn_back->width(),this->height()-btn_back->height());
    //点击返回按钮，返回主界面
    connect(btn_back,&MyPushButton::clicked,[=](){
        QTimer::singleShot(300,[=](){
            this->hide();
            emit this->choosebackmain();
        });

    });

    //创建关卡选择
    stageselect=new StageSelect(this);
    stageselect->setParent(this);

}

void ChooseLevelScene::paintEvent(QPaintEvent *event){
    //设置背景图
    QString str=QString(":/res/PlayLevelSceneBg.png");
    choosebackground=new SetSceneBackGround(this,str);
    //创建主界面标题
    QString str_1=QString(":/res/Title.png");
    choosetitle=new SetChooseTitle(this,str_1);

}
